import java.util.*;

public class NumberNine {
    public static void main(String[] args) {
        //只是打乱顺序用HashSet集合
        Collection<Integer> collection=new HashSet<>();
        collection.add(11);
        collection.add(22);
        collection.add(33);
        collection.add(44);
        collection.add(55);
        collection.add(66);
        collection.add(77);
        collection.forEach(System.out::println);
        //TreeSet默认升序
        Collection collection1=new TreeSet();
        //直接把HashSet集合集合放进TreeSet
        collection1.addAll(collection);
        collection1.forEach(System.out::println);
        //要求降序重写排序方法
        Collection<Integer> collection2=new TreeSet<>((o1,o2)->o2-o1);
        collection2.addAll(collection);
        collection2.forEach(System.out::println);

    }
}
